/**
 *
 * author ThuanLT
 * Aug 20, 2014
 *
 */

package vn.fsoft.gst.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name = "country")
public class Country {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "CountryID")
	private int countryID;

	@Column(name = "CountryName")
	private String countryName;

	public Country() {
	}

	public Country(String countryName) {
		this.countryName = countryName;
	}

	public int getCountryID() {
		return countryID;
	}

	public void setCountryID(int countryID) {
		this.countryID = countryID;
	}

	public String getCountryName() {
		return countryName;
	}

	public void setCountryName(String countryName) {
		this.countryName = countryName;
	}

	public List<Town> getListTown() {
		return listTown;
	}

	public void setListTown(List<Town> listTown) {
		this.listTown = listTown;
	}

	public List<Address> getListAddress() {
		return listAddress;
	}

	public void setListAddress(List<Address> listAddress) {
		this.listAddress = listAddress;
	}


	@OneToMany(mappedBy = "country")
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<Town> listTown;

	@OneToMany(mappedBy = "country")
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<Address> listAddress;

}
